# 转换为整数 int
#字符串str --> 整数int
#纯数字的字符串
s = '2024'
n = int(s)
print(type(s),type(n))
# s1 = 'aaa223'
# print(int(s1))
#浮点数float-->整数int
s11 = 2.23
print(int(s11))
#布尔bool-->整数int
s2,s3 = True,False
print(int(s2),int(s3))


# 转换为浮点数 float
#str-->float
s = '324.6' #有没有小数点都可以
print(float(s))
#int-->float
n = 2024
print(float(n))
#bool-->float
print(float(s2),float(s3))


# 转换为布尔 bool
#str-->bool
s = 'sdw323'
print(bool(s))
s1 = ''
print(bool(s1))
#int --> bool
n = 1
print(bool(n))
#float --> bool
f = 3.0
print(bool(f))



# 转换为字符串 str
#int-->str
n = 5
print(str(n))
print(type(str(n)))
#float --> str
f = 5.3
print(str(f))
print(type(str(f)))
#bool --> str
a = True
print(str(a))
print(type(str(a)))
b = False
print(str(b))
print(type(str(b)))


#进制的转换
s = '1A'
print(int(s,16))

e = 3
f = 3
print(id(e),id(f))
a , b = 3,3
print(id(a),id(b))
